import java.util.Scanner;
public class Main {
    public static void func(String a,String b){
        Scanner scanner=new Scanner(System.in);
        String scan= scanner.nextLine();
        String scan1= scanner.nextLine();
        if(!a.equals(scan)){
            System.out.println("用户名错误");
           throw new RuntimeException();
        }else if(!b.equals(scan1)){
            System.out.println("密码错误");
            throw new RuntimeException();
        }
        System.out.println("登陆成功！");
    }
    public static void main(String[] args) {
        String str = "xxx";
        String str1 = "123";
        try {
            func(str,str1);
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("这里出现异常");
        }
    }
}
   /* public static void main2(String[] args) {
        int a=10;
        try {
            if (a==10){
                throw new RuntimeException();
            }
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("这里有异常");
        }
    }
    public static void func(){
        System.out.println(10);
        int[] arr=new int[]{1,2,3};
        arr[100]=1;
    }
    public static void main1(String[] args) {
        try {
           func();
        }catch (Exception e){
        e.printStackTrace();
        }
        System.out.println("这里有异常！");
    }
}*/